// run: $exec < input
#include <iostream>
#include <algorithm>
#include <vector>

int const maxn = 100007;
bool boungt[maxn];
int n, m;
std::vector<int> discount;
std::vector<int> price;

int main()
{
	std::ios::sync_with_stdio(false);
	std::cin >> m;
	discount.resize(m);
	for (int i = 0; i < m; i++) std::cin >> discount[i];
	std::cin >> n;
	price.resize(n);
	for (int i = 0; i < n; i++) std::cin >> price[i];
	std::sort(discount.begin(), discount.end());
	std::sort(price.begin(), price.end());

	int p = discount[0], ans = 0;
	for (int i = n - 1; i >= 0; ) {
		for (int j = 0; j < p && i - j >= 0; j++)
			ans += price[i - j];
		i -= p;
		for (int j = 0; j < 2 && i >= 0; j++, i--);
	}
	std::cout << ans << '\n';
}

